package com.itheima.health.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.service.SetmealService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("setmeal")
public class SetMealController {

    @Reference
    SetmealService setmealService;

    @GetMapping("findAllSetmeal")
    public Result findAllSetmeal(){

        return new Result(setmealService.list());
    }

    @GetMapping("findSetMealDetail")
    public Result findSetMealDetail(@RequestParam("id") int id){

        return new Result(setmealService.findSetMealDetail(id));
    }

    @GetMapping("findSetMailById")
    public Result findSetMailById(@RequestParam("id") int id){
        return new Result(setmealService.findSetMailById(id));
    }
}
